package ltd.jdsoft.cute.token.model;

import java.io.Serializable;

import org.apache.ibatis.type.Alias;

/**
 * token模型
 * 
 * @author zhengzhq
 *
 */
@Alias("Token")
public class Token implements Serializable {

  private static final long serialVersionUID = -7417966013660900364L;

  /** 登录的token */
  public static final int TOKEN_TYPE_LOGIN = 0;

  // 主键
  private long id;
  // 令牌持有者的id
  private long ownerId;
  // 令牌，通过UUID生成的随机串，原则上令牌是唯一的
  private String token;
  // 令牌类型，比如session令牌、分享令牌等
  private int type;
  // 失效时间，为时间戳
  private long expireTime;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public long getOwnerId() {
    return ownerId;
  }

  public void setOwnerId(long ownerId) {
    this.ownerId = ownerId;
  }

  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

  public int getType() {
    return type;
  }

  public void setType(int type) {
    this.type = type;
  }

  public long getExpireTime() {
    return expireTime;
  }

  public void setExpireTime(long expireTime) {
    this.expireTime = expireTime;
  }
}
